package behavioral.memento;
public class Client {
    private static Originator originator = new Originator();

    private static CareTaker caretaker = new CareTaker();

    public static void main(String[] args) {
        originator.setState("On");
        System.out.println("mState=" + originator.mState);

        caretaker.saveMemento(originator.createMemento());
        originator.setState("Off");
        System.out.println("mState=" + originator.mState);

        originator.setMemento(caretaker.retrieveMemento());
        System.out.println("mState=" + originator.mState);
    }
}
